<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <base data-ice="baseUrl" href="../../../">
  <title data-ice="title">TreeMultiMap | jstreemap Library</title>
  <link type="text/css" rel="stylesheet" href="css/style.css">
  <link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">
  <script src="script/prettify/prettify.js"></script>
  <script src="script/manual.js"></script>
<meta name="description" content="Associative containers (sets, maps) library for JavaScript, using red-black trees."><meta property="twitter:card" content="summary"><meta property="twitter:title" content="jstreemap Library"><meta property="twitter:description" content="Associative containers (sets, maps) library for JavaScript, using red-black trees."></head>
<body class="layout-container" data-ice="rootContainer">

<header>
  <a href="./">Home</a>
  
  <a href="identifiers.html">Reference</a>
  <a href="source.html">Source</a>
  
  <div class="search-box">
  <span>
    <img src="./image/search.png">
    <span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span>
  </span>
    <ul class="search-result"></ul>
  </div>
<a style="position:relative; top:3px;" href="https://github.com/Kirusi/jstreemap"><img width="20px" src="./image/github.png"></a></header>

<nav class="navigation" data-ice="nav"><div>
  <ul>
    
  <li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#public">public</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/public/insertion-result.js~InsertionResult.html">InsertionResult</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/public/iterators.js~BaseIterator.html">BaseIterator</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/public/iterators.js~Iterator.html">Iterator</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/public/iterators.js~ReverseIterator.html">ReverseIterator</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/public/js-iterators.js~JsIterator.html">JsIterator</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/public/js-iterators.js~JsReverseIterator.html">JsReverseIterator</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/public/tree-map.js~TreeMap.html">TreeMap</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/public/tree-multimap.js~TreeMultiMap.html">TreeMultiMap</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/public/tree-multiset.js~TreeMultiSet.html">TreeMultiSet</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/public/tree-set.js~TreeSet.html">TreeSet</a></span></span></li>
</ul>
</div>
</nav>

<div class="content" data-ice="content"><div class="header-notice">
  <div data-ice="importPath" class="import-path"><pre class="prettyprint"><code data-ice="importPathCode">import {TreeMultiMap} from &apos;<span><a href="file/src/public/tree-multimap.js.html#lineNumber45">jstreemap/src/public/tree-multimap.js</a></span>&apos;</code></pre></div>
  <span data-ice="access">public</span>
  <span data-ice="kind">class</span>
  
  
  
  <span data-ice="source">| <span><a href="file/src/public/tree-multimap.js.html#lineNumber45">source</a></span></span>
</div>

<div class="self-detail detail">
  <h1 data-ice="name">TreeMultiMap</h1>

  

  
  
  
  
  
  
  
  
  

  
  
  <div class="description" data-ice="description"><p>TreeMultiMap is an associative container that stores elements formed by
a combination of a key value and a mapped value, following a specific order,
and where multiple elements can have equivalent keys.</p>
<p>In a TreeMultiMap, the key values are generally used to sort and uniquely
identify the elements, while the mapped values store the content
associated to this key. The types of key and mapped value may differ.</p>
<h2 id="container-properties">Container properties</h2><ul>
<li><strong>Associative</strong> - Elements in associative containers are referenced
by their key and not by their absolute position in the container.</li>
<li><strong>Ordered</strong> - The elements in the container follow a strict order
at all times. All inserted elements are given a position in this order.</li>
<li><strong>Map</strong> - Each element associates a key to a mapped value. Keys are meant
to identify the elements whose main content is the mapped value.</li>
<li><strong>Multiple equivalent keys</strong> - Multiple elements in the container
can have equivalent keys.</li>
</ul>
</div>
  

  

  <div data-ice="exampleDocs">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">let map = new TreeMultiMap();
// add few values
map.set(1, &apos;a&apos;);
map.set(2, &apos;b&apos;);
map.set(2, &apos;c&apos;);
// find a value by key
let v = map.get(1); // &lt;&lt; &apos;a&apos;
find all values for a given key
// print all key-value pairs
let from = map.lowerBound(2);
let to = map.upperBound(2);
let it = from;
while (!it.equals(to)) {
  console.log(it.key);
  it.next();
}</code></pre>
    </div>
</div>

  

  
</div>

<div data-ice="staticMemberSummary"><h2>Static Member Summary</h2><table class="summary" data-ice="summary">
  <thead><tr><td data-ice="title" colspan="3">Static Public Members</td></tr></thead>
  <tbody>
  
  <tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      <span data-ice="static">static</span>
      <span class="kind" data-ice="kind">get</span>
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="class/src/public/tree-multimap.js~TreeMultiMap.html#static-get-[Symbol.species]">[Symbol.species]</a></span></span><span class="code" data-ice="signature">: <span>*</span>: <span>*</span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Allows to create programmatically an instance of the same class</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
</tbody>
</table>
</div>

<div data-ice="constructorSummary"><h2>Constructor Summary</h2><table class="summary" data-ice="summary">
  <thead><tr><td data-ice="title" colspan="3">Public Constructor</td></tr></thead>
  <tbody>
  
  <tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="class/src/public/tree-multimap.js~TreeMultiMap.html#instance-constructor-constructor">constructor</a></span></span><span class="code" data-ice="signature">(iterable: <span>*</span>)</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Creates an empty, or a pre-initialized map.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
</tbody>
</table>
</div>
<div data-ice="memberSummary"><h2>Member Summary</h2><table class="summary" data-ice="summary">
  <thead><tr><td data-ice="title" colspan="3">Public Members</td></tr></thead>
  <tbody>
  
  <tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      <span class="kind" data-ice="kind">get</span>
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="class/src/public/tree-multimap.js~TreeMultiMap.html#instance-get-[Symbol.toStringTag]">[Symbol.toStringTag]</a></span></span><span class="code" data-ice="signature">: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></span>: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>String tag of this class</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      <span class="kind" data-ice="kind">set</span>
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="class/src/public/tree-multimap.js~TreeMultiMap.html#instance-set-compareFunc">compareFunc</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Sets custom comparison function if key values are not of primitive types.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      <span class="kind" data-ice="kind">get</span>
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="class/src/public/tree-multimap.js~TreeMultiMap.html#instance-get-size">size</a></span></span><span class="code" data-ice="signature">: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a></span>: <span>*</span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Number of key-value pairs in the map.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
</tbody>
</table>
</div>
<div data-ice="methodSummary"><h2>Method Summary</h2><table class="summary" data-ice="summary">
  <thead><tr><td data-ice="title" colspan="3">Public Methods</td></tr></thead>
  <tbody>
  
  <tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="class/src/public/tree-multimap.js~TreeMultiMap.html#instance-method-[Symbol.iterator]">[Symbol.iterator]</a></span></span><span class="code" data-ice="signature">(): <span><a href="class/src/public/js-iterators.js~JsIterator.html">JsIterator</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Forward ES6 iterator for all key-value pairs in ascending order of the keys.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="class/src/public/tree-multimap.js~TreeMultiMap.html#instance-method-backward">backward</a></span></span><span class="code" data-ice="signature">(): <span><a href="class/src/public/js-iterators.js~JsReverseIterator.html">JsReverseIterator</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>ES6 reverse iterator for all key-value pairs in descending order of the keys.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="class/src/public/tree-multimap.js~TreeMultiMap.html#instance-method-begin">begin</a></span></span><span class="code" data-ice="signature">(): <span><a href="class/src/public/iterators.js~Iterator.html">Iterator</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Forward iterator to the first element</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="class/src/public/tree-multimap.js~TreeMultiMap.html#instance-method-clear">clear</a></span></span><span class="code" data-ice="signature">()</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Removes all key-value pairs.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="class/src/public/tree-multimap.js~TreeMultiMap.html#instance-method-delete">delete</a></span></span><span class="code" data-ice="signature">(key: <span>*</span>)</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Removes key-value pair with the specified key if such entry exists.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="class/src/public/tree-multimap.js~TreeMultiMap.html#instance-method-end">end</a></span></span><span class="code" data-ice="signature">(): <span><a href="class/src/public/iterators.js~Iterator.html">Iterator</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Forward iterator to the element following the last element</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="class/src/public/tree-multimap.js~TreeMultiMap.html#instance-method-entries">entries</a></span></span><span class="code" data-ice="signature">(): <span><a href="class/src/public/js-iterators.js~JsIterator.html">JsIterator</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Forward ES6 iterator for all key-value pairs in ascending order of the keys.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="class/src/public/tree-multimap.js~TreeMultiMap.html#instance-method-erase">erase</a></span></span><span class="code" data-ice="signature">(iterator: <span><a href="class/src/public/iterators.js~Iterator.html">Iterator</a></span>)</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Removes key-value pair for the specified iterator.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="class/src/public/tree-multimap.js~TreeMultiMap.html#instance-method-find">find</a></span></span><span class="code" data-ice="signature">(key: <span>*</span>): <span><a href="class/src/public/iterators.js~Iterator.html">Iterator</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Finds an element with key equivalent to the specified one.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="class/src/public/tree-multimap.js~TreeMultiMap.html#instance-method-first">first</a></span></span><span class="code" data-ice="signature">(): <span>*</span></span>
        </p>
      </div>
      <div>
        
        
        
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="class/src/public/tree-multimap.js~TreeMultiMap.html#instance-method-forEach">forEach</a></span></span><span class="code" data-ice="signature">(callback: <span>*</span>)</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Iterates all key-value pairs using a callback in ascending order of the keys.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="class/src/public/tree-multimap.js~TreeMultiMap.html#instance-method-get">get</a></span></span><span class="code" data-ice="signature">(key: <span>*</span>): <span>*</span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Finds value associated with the specified key.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="class/src/public/tree-multimap.js~TreeMultiMap.html#instance-method-has">has</a></span></span><span class="code" data-ice="signature">(key: <span>*</span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>A boolean indicator whether map contains a key-value pair with the specified key</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="class/src/public/tree-multimap.js~TreeMultiMap.html#instance-method-insertMulti">insertMulti</a></span></span><span class="code" data-ice="signature">(key: <span>*</span>, value: <span>*</span>): <span><a href="class/src/public/insertion-result.js~InsertionResult.html">InsertionResult</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Adds key-value pair.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="class/src/public/tree-multimap.js~TreeMultiMap.html#instance-method-insertOrReplace">insertOrReplace</a></span></span><span class="code" data-ice="signature">(key: <span>*</span>, value: <span>*</span>): <span><a href="class/src/public/insertion-result.js~InsertionResult.html">InsertionResult</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Adds key-value pair if such key does not exist in the map.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="class/src/public/tree-multimap.js~TreeMultiMap.html#instance-method-insertUnique">insertUnique</a></span></span><span class="code" data-ice="signature">(key: <span>*</span>, value: <span>*</span>): <span><a href="class/src/public/insertion-result.js~InsertionResult.html">InsertionResult</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Adds key-value pair if such key does not exist in the map</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="class/src/public/tree-multimap.js~TreeMultiMap.html#instance-method-keys">keys</a></span></span><span class="code" data-ice="signature">(): <span><a href="class/src/public/js-iterators.js~JsIterator.html">JsIterator</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Forward ES6 iterator for all keys in ascending order of the keys.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="class/src/public/tree-multimap.js~TreeMultiMap.html#instance-method-last">last</a></span></span><span class="code" data-ice="signature">(): <span>*</span></span>
        </p>
      </div>
      <div>
        
        
        
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="class/src/public/tree-multimap.js~TreeMultiMap.html#instance-method-lowerBound">lowerBound</a></span></span><span class="code" data-ice="signature">(key: <span>*</span>): <span><a href="class/src/public/iterators.js~Iterator.html">Iterator</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Iterator pointing to the first element that is not less than specified key.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="class/src/public/tree-multimap.js~TreeMultiMap.html#instance-method-rbegin">rbegin</a></span></span><span class="code" data-ice="signature">(): <span><a href="class/src/public/iterators.js~ReverseIterator.html">ReverseIterator</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Reverse iterator to the last element.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="class/src/public/tree-multimap.js~TreeMultiMap.html#instance-method-rend">rend</a></span></span><span class="code" data-ice="signature">(): <span><a href="class/src/public/iterators.js~ReverseIterator.html">ReverseIterator</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Reverse iterator pointing to before the first element.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="class/src/public/tree-multimap.js~TreeMultiMap.html#instance-method-set">set</a></span></span><span class="code" data-ice="signature">(key: <span>*</span>, value: <span>*</span>)</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Adds a key-value pair to the map.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="class/src/public/tree-multimap.js~TreeMultiMap.html#instance-method-toString">toString</a></span></span><span class="code" data-ice="signature">(): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Serializes contents of the map in the form {key1:value1,key2:value2,...}</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="class/src/public/tree-multimap.js~TreeMultiMap.html#instance-method-upperBound">upperBound</a></span></span><span class="code" data-ice="signature">(key: <span>*</span>): <span><a href="class/src/public/iterators.js~Iterator.html">Iterator</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Iterator pointing to the first element that is greater than key.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="class/src/public/tree-multimap.js~TreeMultiMap.html#instance-method-values">values</a></span></span><span class="code" data-ice="signature">(): <span>JsITerator</span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Forward ES6 iterator for all values in ascending order of the keys.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
</tbody>
</table>
</div>



<div data-ice="staticMemberDetails"><h2 data-ice="title">Static Public Members</h2>

<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-get-[Symbol.species]">
    <span class="access" data-ice="access">public</span>
    <span data-ice="static">static</span>
    <span class="kind" data-ice="kind">get</span>
    
    
    
    <span class="code" data-ice="name">[Symbol.species]</span><span class="code" data-ice="signature">: <span>*</span>: <span>*</span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/src/public/tree-multimap.js.html#lineNumber95">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Allows to create programmatically an instance of the same class</p>
</div>

  

  <div data-ice="properties">
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span>*</span></td>
          <td class="return-desc" data-ice="returnDescription"><p>constructor object for this class.</p>
</td>
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">let map = new TreeMultiMap();
let constrFunc = Object.getPrototypeOf(map).constructor[Symbol.species];
let map2 = new constrFunc();</code></pre>
    </div>
</div>

  

  
  
</div>
</div>

<div data-ice="constructorDetails"><h2 data-ice="title">Public Constructors</h2>

<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-constructor-constructor">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">constructor</span><span class="code" data-ice="signature">(iterable: <span>*</span>)</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/src/public/tree-multimap.js.html#lineNumber59">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Creates an empty, or a pre-initialized map.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">iterable</td>
      <td data-ice="type" class="code"><span>*</span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Another iterable object whose key-value pairs are added into the newly created map.</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">// Create an empty map
let map1 = new TreeMultiMap();
// Create and initialize map
let map2 = new TreeMultiMap([[1, &apos;A&apos;], [2, &apos;B&apos;], [3, &apos;C&apos;]]);</code></pre>
    </div>
</div>

  

  
  
</div>
</div>
<div data-ice="memberDetails"><h2 data-ice="title">Public Members</h2>

<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-get-[Symbol.toStringTag]">
    <span class="access" data-ice="access">public</span>
    
    <span class="kind" data-ice="kind">get</span>
    
    
    
    <span class="code" data-ice="name">[Symbol.toStringTag]</span><span class="code" data-ice="signature">: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></span>: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/src/public/tree-multimap.js.html#lineNumber83">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>String tag of this class</p>
</div>

  

  <div data-ice="properties">
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">Object.prototype.toString.call(new TreeMultiMap()); // &quot;[object TreeMultiMap]&quot;</code></pre>
    </div>
</div>

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-set-compareFunc">
    <span class="access" data-ice="access">public</span>
    
    <span class="kind" data-ice="kind">set</span>
    
    
    
    <span class="code" data-ice="name">compareFunc</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/src/public/tree-multimap.js.html#lineNumber291">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Sets custom comparison function if key values are not of primitive types.
Callback is a 3-way comparison function accepts two key values (lhs, rhs). It is expected to return
     +1 if the value of rhs is greater than lhs
     -1 if the value of rhs is less than lhs
      0 if values are the same</p>
</div>

  

  <div data-ice="properties">
</div>

  

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-get-size">
    <span class="access" data-ice="access">public</span>
    
    <span class="kind" data-ice="kind">get</span>
    
    
    
    <span class="code" data-ice="name">size</span><span class="code" data-ice="signature">: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a></span>: <span>*</span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/src/public/tree-multimap.js.html#lineNumber232">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Number of key-value pairs in the map.</p>
</div>

  

  <div data-ice="properties">
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
</div>
<div data-ice="methodDetails"><h2 data-ice="title">Public Methods</h2>

<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-[Symbol.iterator]">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">[Symbol.iterator]</span><span class="code" data-ice="signature">(): <span><a href="class/src/public/js-iterators.js~JsIterator.html">JsIterator</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/src/public/tree-multimap.js.html#lineNumber264">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Forward ES6 iterator for all key-value pairs in ascending order of the keys. The same as entries() method</p>
</div>

  

  <div data-ice="properties">
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="class/src/public/js-iterators.js~JsIterator.html">JsIterator</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">let map = new TreeMultiMap([[1, &apos;A&apos;], [2, &apos;B&apos;], [3, &apos;C&apos;]]);
for (let [key,value] of map) {
  console.log(`key: ${key}, value: ${value}`);
}</code></pre>
    </div>
</div>

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-backward">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">backward</span><span class="code" data-ice="signature">(): <span><a href="class/src/public/js-iterators.js~JsReverseIterator.html">JsReverseIterator</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/src/public/tree-multimap.js.html#lineNumber280">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>ES6 reverse iterator for all key-value pairs in descending order of the keys.</p>
</div>

  

  <div data-ice="properties">
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="class/src/public/js-iterators.js~JsReverseIterator.html">JsReverseIterator</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">let map = new TreeMultiMap([[1, &apos;A&apos;], [2, &apos;B&apos;], [3, &apos;C&apos;]]);
for (let [key,value] of map.backwards()) {
  console.log(`key: ${key}, value: ${value}`);
}</code></pre>
    </div>
</div>

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-begin">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">begin</span><span class="code" data-ice="signature">(): <span><a href="class/src/public/iterators.js~Iterator.html">Iterator</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/src/public/tree-multimap.js.html#lineNumber310">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Forward iterator to the first element</p>
</div>

  

  <div data-ice="properties">
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="class/src/public/iterators.js~Iterator.html">Iterator</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">let m = new TreeMultiMap();
...
for (let it = m.begin(); !it.equals(m.end()); it.next()) {
  console.log(`key: ${it.key}, value: ${it.value}`);
}</code></pre>
    </div>
</div>

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-clear">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">clear</span><span class="code" data-ice="signature">()</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/src/public/tree-multimap.js.html#lineNumber106">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Removes all key-value pairs.</p>
</div>

  

  <div data-ice="properties">
</div>

  

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">let map = new TreeMultiMap([[1, &apos;A&apos;], [2, &apos;B&apos;], [3, &apos;C&apos;]]);
map.clear();
console.log(map.size); // 0</code></pre>
    </div>
</div>

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-delete">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">delete</span><span class="code" data-ice="signature">(key: <span>*</span>)</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/src/public/tree-multimap.js.html#lineNumber117">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Removes key-value pair with the specified key if such entry exists. Does nothing otherwise.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">key</td>
      <td data-ice="type" class="code"><span>*</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"></td>
    </tr>
</tbody>
  </table>
</div>
</div>

  

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">let map = new TreeMultiMap([[1, &apos;A&apos;], [2, &apos;B&apos;], [3, &apos;C&apos;]]);
map.delete(2);
console.log(map.toString()); // {1:A,3:C}</code></pre>
    </div>
</div>

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-end">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">end</span><span class="code" data-ice="signature">(): <span><a href="class/src/public/iterators.js~Iterator.html">Iterator</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/src/public/tree-multimap.js.html#lineNumber324">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Forward iterator to the element following the last element</p>
</div>

  

  <div data-ice="properties">
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="class/src/public/iterators.js~Iterator.html">Iterator</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">let m = new TreeMultiMap();
...
for (let it = m.begin(); !it.equals(m.end()); it.next()) {
  console.log(`key: ${it.key}, value: ${it.value}`);
}</code></pre>
    </div>
</div>

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-entries">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">entries</span><span class="code" data-ice="signature">(): <span><a href="class/src/public/js-iterators.js~JsIterator.html">JsIterator</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/src/public/tree-multimap.js.html#lineNumber133">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Forward ES6 iterator for all key-value pairs in ascending order of the keys.</p>
</div>

  

  <div data-ice="properties">
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="class/src/public/js-iterators.js~JsIterator.html">JsIterator</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">let map = new TreeMultiMap([[1, &apos;A&apos;], [2, &apos;B&apos;], [3, &apos;C&apos;]]);
for (let [key,value] of map.entries()) {
  console.log(`key: ${key}, value: ${value}`);
}</code></pre>
    </div>
</div>

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-erase">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">erase</span><span class="code" data-ice="signature">(iterator: <span><a href="class/src/public/iterators.js~Iterator.html">Iterator</a></span>)</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/src/public/tree-multimap.js.html#lineNumber425">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Removes key-value pair for the specified iterator.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">iterator</td>
      <td data-ice="type" class="code"><span><a href="class/src/public/iterators.js~Iterator.html">Iterator</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"></td>
    </tr>
</tbody>
  </table>
</div>
</div>

  

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">let map = new TreeMultiMap([[1, &apos;A&apos;], [2, &apos;B&apos;], [3, &apos;C&apos;]]);
let it = map.find(2);
it.prev();
map.erase(it); // removes a node with key 1
console.log(map.toString()); // {2:B,3:C}</code></pre>
    </div>
</div>

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-find">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">find</span><span class="code" data-ice="signature">(key: <span>*</span>): <span><a href="class/src/public/iterators.js~Iterator.html">Iterator</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/src/public/tree-multimap.js.html#lineNumber340">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Finds an element with key equivalent to the specified one. If such key does not exist end() iterator is returned.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">key</td>
      <td data-ice="type" class="code"><span>*</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"></td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="class/src/public/iterators.js~Iterator.html">Iterator</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">let m = new TreeMultiMap([[1, &apos;A&apos;], [2, &apos;B&apos;], [3, &apos;C&apos;]]);
...
let it = m.find(1);
if (!it.equals(m.end())) {
  console.log(`key: ${it.key}, value: ${it.value}`); // 1, &apos;A&apos;
}</code></pre>
    </div>
</div>

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-first">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">first</span><span class="code" data-ice="signature">(): <span>*</span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/src/public/tree-multimap.js.html#lineNumber529">source</a></span></span>
    </span>
  </h3>

  
  
  
  

  

  <div data-ice="properties">
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span>*</span></td>
          <td class="return-desc" data-ice="returnDescription"><p>first key/value pair of the container, or undefined if container is empty</p>
</td>
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">let m = new TreeMultiMap([[1, &apos;A&apos;], [2, &apos;B&apos;], [3, &apos;C&apos;]]);
let first = m.first();
if (first) {
  let key = first[0];   // 1
  let value = first[1]; // &apos;A&apos;
}</code></pre>
    </div>
</div>

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-forEach">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">forEach</span><span class="code" data-ice="signature">(callback: <span>*</span>)</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/src/public/tree-multimap.js.html#lineNumber146">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Iterates all key-value pairs using a callback in ascending order of the keys.
Note that ES6 specifies the order of key value parameters in the callback differently from for-of loop.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">callback</td>
      <td data-ice="type" class="code"><span>*</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"></td>
    </tr>
</tbody>
  </table>
</div>
</div>

  

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">let map = new TreeMultiMap([[1, &apos;A&apos;], [2, &apos;B&apos;], [3, &apos;C&apos;]]);
map.forEach(function(value, key, container) {
  console.log(`key: ${key}, value: ${value}`);
});</code></pre>
    </div>
</div>

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-get">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">get</span><span class="code" data-ice="signature">(key: <span>*</span>): <span>*</span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/src/public/tree-multimap.js.html#lineNumber161">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Finds value associated with the specified key. If specified key does not exist then undefined is returned.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">key</td>
      <td data-ice="type" class="code"><span>*</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>a value of any type that can be compared with a key</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span>*</span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">let map = new TreeMultiMap([[1, &apos;A&apos;], [2, &apos;B&apos;], [3, &apos;C&apos;]]);
let v = map.get(3); // &apos;C&apos;
* let v = map.get(4); // returns undefined</code></pre>
    </div>
</div>

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-has">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">has</span><span class="code" data-ice="signature">(key: <span>*</span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/src/public/tree-multimap.js.html#lineNumber179">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>A boolean indicator whether map contains a key-value pair with the specified key</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">key</td>
      <td data-ice="type" class="code"><span>*</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>a value of any type that can be compared with a key</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">let map = new TreeMultiMap([[1, &apos;A&apos;], [2, &apos;B&apos;], [3, &apos;C&apos;]]);
let b = map.get(3); // true</code></pre>
    </div>
</div>

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-insertMulti">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">insertMulti</span><span class="code" data-ice="signature">(key: <span>*</span>, value: <span>*</span>): <span><a href="class/src/public/insertion-result.js~InsertionResult.html">InsertionResult</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/src/public/tree-multimap.js.html#lineNumber408">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Adds key-value pair. If such key already exists in the map then adds another node with the same key and a new value.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">key</td>
      <td data-ice="type" class="code"><span>*</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"></td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">value</td>
      <td data-ice="type" class="code"><span>*</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"></td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="class/src/public/insertion-result.js~InsertionResult.html">InsertionResult</a></span></td>
          <td class="return-desc" data-ice="returnDescription"><p>indicates whether a node was added and provides iterator to it.</p>
</td>
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">let m = new TreeMultiMap();
let res = m.insertMulti(1, &apos;A&apos;);
if (res.wasInserted) {
  console.log(`Inserted ${res.iterator.value}`); // prints A
}
res = m.insertMulti(1, &apos;B&apos;) // adds a new node
if (res.wasInserted) {
  console.log(`Inserted ${res.iterator.value}`); // prints B
  it.prev();
  console.log(`Previously inserted ${res.iterator.value}`); // prints A
}</code></pre>
    </div>
</div>

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-insertOrReplace">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">insertOrReplace</span><span class="code" data-ice="signature">(key: <span>*</span>, value: <span>*</span>): <span><a href="class/src/public/insertion-result.js~InsertionResult.html">InsertionResult</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/src/public/tree-multimap.js.html#lineNumber383">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Adds key-value pair if such key does not exist in the map. Replaces value if such key exists</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">key</td>
      <td data-ice="type" class="code"><span>*</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"></td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">value</td>
      <td data-ice="type" class="code"><span>*</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"></td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="class/src/public/insertion-result.js~InsertionResult.html">InsertionResult</a></span></td>
          <td class="return-desc" data-ice="returnDescription"><p>indicates whether a node was added and provides iterator to it.</p>
</td>
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">let m = new TreeMultiMap();
let res = m.insertOrReplace(1, &apos;A&apos;);
if (res.wasInserted) {
  console.log(`Inserted ${res.iterator.value}`); // prints A
}
res = m.insertOrReplace(1, &apos;B&apos;) // replaces value on the existing node
if (res.wasInserted) {
  console.log(`Inserted ${res.iterator.key}`); // prints B
}</code></pre>
    </div>
</div>

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-insertUnique">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">insertUnique</span><span class="code" data-ice="signature">(key: <span>*</span>, value: <span>*</span>): <span><a href="class/src/public/insertion-result.js~InsertionResult.html">InsertionResult</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/src/public/tree-multimap.js.html#lineNumber360">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Adds key-value pair if such key does not exist in the map</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">key</td>
      <td data-ice="type" class="code"><span>*</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"></td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">value</td>
      <td data-ice="type" class="code"><span>*</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"></td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="class/src/public/insertion-result.js~InsertionResult.html">InsertionResult</a></span></td>
          <td class="return-desc" data-ice="returnDescription"><p>indicates whether a node was added and provides iterator to it.</p>
</td>
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">let m = new TreeMultiMap();
let res = m.insertUnique(1, &apos;A&apos;);
if (res.wasInserted) {
  console.log(`Inserted ${res.iterator.value}`); // prints A
}
res = m.insertUnique(1, &apos;B&apos;) // this step has no effect on the map
if (res.wasInserted) {
  console.log(`Inserted ${res.iterator.key}`); // not executed
}</code></pre>
    </div>
</div>

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-keys">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">keys</span><span class="code" data-ice="signature">(): <span><a href="class/src/public/js-iterators.js~JsIterator.html">JsIterator</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/src/public/tree-multimap.js.html#lineNumber204">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Forward ES6 iterator for all keys in ascending order of the keys.</p>
</div>

  

  <div data-ice="properties">
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="class/src/public/js-iterators.js~JsIterator.html">JsIterator</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">// iterate all keys
let map = new TreeMultiMap([[1, &apos;A&apos;], [2, &apos;B&apos;], [3, &apos;C&apos;]]);
for (let k of map.keys()) {
  console.log(k); // 1, 2, 3
}
// iterate all keys in reverse order
let map = new TreeMultiMap([[1, &apos;A&apos;], [2, &apos;B&apos;], [3, &apos;C&apos;]]);
for (let k of map.keys().backward()) {
  console.log(k); // 3, 2, 1
}</code></pre>
    </div>
</div>

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-last">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">last</span><span class="code" data-ice="signature">(): <span>*</span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/src/public/tree-multimap.js.html#lineNumber543">source</a></span></span>
    </span>
  </h3>

  
  
  
  

  

  <div data-ice="properties">
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span>*</span></td>
          <td class="return-desc" data-ice="returnDescription"><p>last key/value pair of the container, or undefined if container is empty</p>
</td>
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">let m = new TreeMultiMap([[1, &apos;A&apos;], [2, &apos;B&apos;], [3, &apos;C&apos;]]);
let last = m.last();
if (last) {
  let key = last[0];   // 3
  let value = last[1]; // &apos;C&apos;
}</code></pre>
    </div>
</div>

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-lowerBound">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">lowerBound</span><span class="code" data-ice="signature">(key: <span>*</span>): <span><a href="class/src/public/iterators.js~Iterator.html">Iterator</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/src/public/tree-multimap.js.html#lineNumber456">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Iterator pointing to the first element that is not less than specified key. If no such element is found, see end() iterator is returned.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">key</td>
      <td data-ice="type" class="code"><span>*</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"></td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="class/src/public/iterators.js~Iterator.html">Iterator</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">let m = new TreeMultiMap();
... // add key-value pairs., using numbers as keys
// iterate through all key-value pairs with keys between 0 and 50 inclusive
let from = m.lowerBound(0);
let to = m.upperBound(50);
let it = from;
while (!it.equals(to)) {
  console.log(it.key);
  it.next();
}

let m = new TreeMultiMap();
... // add key-value pairs., using numbers as keys
// iterate through all key-value pairs with keys between 0 and 50 inclusive in reverse order
let from = new ReverseIterator(m.upperBound(50));
let to = new ReverseIterator(m.lowerBound(0));
let it = from;
while (!it.equals(to)) {
  console.log(it.key);
  it.next();
}</code></pre>
    </div>
</div>

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-rbegin">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">rbegin</span><span class="code" data-ice="signature">(): <span><a href="class/src/public/iterators.js~ReverseIterator.html">ReverseIterator</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/src/public/tree-multimap.js.html#lineNumber470">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Reverse iterator to the last element.</p>
</div>

  

  <div data-ice="properties">
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="class/src/public/iterators.js~ReverseIterator.html">ReverseIterator</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">let m = new TreeMultiMap();
...
for (let it = m.rbegin(); !it.equals(m.rend()); it.next()) {
  console.log(`key: ${it.key}, value: ${it.value}`);
}</code></pre>
    </div>
</div>

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-rend">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">rend</span><span class="code" data-ice="signature">(): <span><a href="class/src/public/iterators.js~ReverseIterator.html">ReverseIterator</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/src/public/tree-multimap.js.html#lineNumber484">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Reverse iterator pointing to before the first element.</p>
</div>

  

  <div data-ice="properties">
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="class/src/public/iterators.js~ReverseIterator.html">ReverseIterator</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">let m = new TreeMultiMap();
...
for (let it = m.rbegin(); !it.equals(m.rend()); it.next()) {
  console.log(`key: ${it.key}, value: ${it.value}`);
}</code></pre>
    </div>
</div>

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-set">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">set</span><span class="code" data-ice="signature">(key: <span>*</span>, value: <span>*</span>)</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/src/public/tree-multimap.js.html#lineNumber221">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Adds a key-value pair to the map. Multiple key-value pairs with the same key are allowed in TreeMultiMap.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">key</td>
      <td data-ice="type" class="code"><span>*</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"></td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">value</td>
      <td data-ice="type" class="code"><span>*</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"></td>
    </tr>
</tbody>
  </table>
</div>
</div>

  

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">let map = new TreeMultiMap();
map.set(1, &apos;A&apos;);
map.set(1, &apos;B&apos;);
map.set(2, &apos;C&apos;);
for (let k of map.values()) {
  console.log(k); // A, B, C
}</code></pre>
    </div>
</div>

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-toString">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">toString</span><span class="code" data-ice="signature">(): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/src/public/tree-multimap.js.html#lineNumber551">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Serializes contents of the map in the form {key1:value1,key2:value2,...}</p>
</div>

  

  <div data-ice="properties">
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-upperBound">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">upperBound</span><span class="code" data-ice="signature">(key: <span>*</span>): <span><a href="class/src/public/iterators.js~Iterator.html">Iterator</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/src/public/tree-multimap.js.html#lineNumber515">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Iterator pointing to the first element that is greater than key. If no such element is found end() iterator is returned.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">key</td>
      <td data-ice="type" class="code"><span>*</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"></td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="class/src/public/iterators.js~Iterator.html">Iterator</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">let m = new TreeMultiMap();
... // add key-value pairs., using numbers as keys
// iterate through all key-value pairs with keys between 0 and 50 inclusive
let from = m.lowerBound(0);
let to = m.upperBound(50);
let it = from;
while (!it.equals(to)) {
  console.log(it.key);
  it.next();
}

let m = new TreeMultiMap();
... // add key-value pairs., using numbers as keys
// iterate through all key-value pairs with keys between 0 and 50 inclusive in reverse order
let from = new ReverseIterator(m.upperBound(50));
let to = new ReverseIterator(m.lowerBound(0));
let it = from;
while (!it.equals(to)) {
  console.log(it.key);
  it.next();
}</code></pre>
    </div>
</div>

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-values">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">values</span><span class="code" data-ice="signature">(): <span>JsITerator</span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/src/public/tree-multimap.js.html#lineNumber251">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Forward ES6 iterator for all values in ascending order of the keys.</p>
</div>

  

  <div data-ice="properties">
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span>JsITerator</span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">// iterate all values
let map = new TreeMultiMap([[1, &apos;A&apos;], [2, &apos;B&apos;], [3, &apos;C&apos;]]);
for (let v of map.values()) {
  console.log(v); // &apos;A&apos;, &apos;B&apos;, &apos;C&apos;
}
// iterate all values in reverse order
let map = new TreeMultiMap([[1, &apos;A&apos;], [2, &apos;B&apos;], [3, &apos;C&apos;]]);
for (let v of map.values().backward()) {
  console.log(v); // &apos;C&apos;, &apos;B&apos;, &apos;A&apos;
}</code></pre>
    </div>
</div>

  

  
  
</div>
</div>
</div>

<footer class="footer">
  Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(1.0.4)</span><img src="./image/esdoc-logo-mini-black.png"></a>
</footer>

<script src="script/search_index.js"></script>
<script src="script/search.js"></script>
<script src="script/pretty-print.js"></script>
<script src="script/inherited-summary.js"></script>
<script src="script/test-summary.js"></script>
<script src="script/inner-link.js"></script>
<script src="script/patch-for-local.js"></script>
</body>
</html>
